# 
import unittest
from Pid import *

class PidTests(unittest.TestCase):
    def setUp(self):
        self.numPid=Pid(700107557)
        self.strPid=Pid("700107557")

    def testNumPidMatchesNum(self):
        scan=700107557
        cand=Pid(scan)
        assert self.numPid.matches(cand), \
            "cand='%s' !matches numPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testStrPidMatchesGetStr(self):
        scan="700107557"
        cand=Pid(scan)
        assert self.strPid.matches(cand), \
            "cand='%s' !matches strPid='%s'" % (cand.getStr(), self.strPid.getStr())

    def testNumPidMatchesGetStr(self):
        scan="700107557"
        cand=Pid(scan)
        assert self.numPid.matches(cand), \
            "cand='%s' !matches numPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testStrPidMatchesNum(self):
        scan=700107557
        cand=Pid(scan)
        assert self.strPid.matches(cand), \
            "cand='%s' !matches strPid='%s'" % (cand.getStr(), self.strPid.getStr())

    def testNumPidDoesntMatchNum(self):
        scan=700107558
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testStrPidDoesntMatchGetStr(self):
        scan="700107558"
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testNumPidDoesntMatchGetStr(self):
        scan="700107558"
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testStrPidDoesntMatchNum(self):
        scan=700107558
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testNumPidDoesntMatchZeroNum(self):
        scan=0
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (cand.getStr(), self.numPid.getStr())

    def testNumPidDoesntMatchZeroStr(self):
        scan="0"
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testStrPidDoesntMatchZeroNum(self):
        scan=0
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (cand.getStr(), self.strPid.getStr())

    def testStrPidDoesntMatchZeroStr(self):
        scan="0"
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (cand.getStr(), self.strPid.getStr())

    def testNumPidDoesntMatchFalseBool(self):
        scan=False
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testStrPidDoesntMatchFalseBool(self):
        scan=False
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testStrPidDoesntMatchFalseStr(self):
        scan="False"
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (cand.getStr(), self.strPid.getStr())

    def testNumPidDoesntMatchFalseStr(self):
        scan="False"
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testNumPidDoesntMatchTrueBool(self):
        scan=True
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testStrPidDoesntMatchTrueBool(self):
        scan=True
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (scan, self.strPid.getStr())

    def testNumPidDoesntMatchTrueStr(self):
        scan="True"
        cand=Pid(scan)
        assert not self.numPid.matches(cand), \
            "cand='%s' matches numPid='%s'" % (scan, self.numPid.getStr())

    def testStrPidDoesntMatchTrueStr(self):
        scan="True"
        cand=Pid(scan)
        assert not self.strPid.matches(cand), \
            "cand='%s' matches strPid='%s'" % (scan, self.strPid.getStr())

    def suite():
        suite = unittest.TestSuite()
        suite.addTest(unittest.makeSuite(PidTests))
        return suite

def main():
    unittest.main()

if __name__ == '__main__':
    main()
